import configparser

config_file = configparser.ConfigParser()

#Add section
config_file.add_section("OBT")
#Add settings to section
config_file.set("OBT", "userid", "zdhcs49372")
config_file.set("OBT", "password", "dww123456")

#save config file
with open(r"configurations.ini", 'w') as configfileObj:
    config_file.write(configfileObj)
    configfileObj.flush()
    configfileObj.close()
